-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRAFT: 54 dataset #59
base: main
Are you sure you want to change the base?
Conversation
@@ -21,7 +21,9 @@ class DequantizedDataset(torch.utils.data.Dataset): | |||
def __init__( | |||
self, | |||
dataset: T.Union[os.PathLike, torch.utils.data.Dataset, np.ndarray], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also specify here that dataset can be a torch.Tensor as well?
@@ -30,6 +32,13 @@ def __init__( | |||
else: | |||
self.dataset = pd.read_csv(dataset).values | |||
|
|||
# | |||
self.dataset = self.dataset.to(device) | |||
if not isinstance(labels, torch.Tensor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If dataset is a torch.utils.data.Dataset we don't need labels right? It automatically has a getitem method that returns the data and the label. So I would need to add a check here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think The baseclass getitem method is going to fail if the dataset is only a np array or a torch.Tensor. I understand there is the correct implementation in the derived class but maybe here we would need to put a check or raise an error?
@@ -21,8 +21,9 @@ class DequantizedDataset(torch.utils.data.Dataset): | |||
def __init__( | |||
self, | |||
dataset: T.Union[os.PathLike, torch.utils.data.Dataset, np.ndarray], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to have a dataset object like a dictionary with images/labels? Otherwise I would renamed this "images" instead of dataset since we now have the labels object as well.
PR for implementing a dataset with the right label associated to the image.
Previously the getitem method returned only the MNISt image with a dummy label always set to 0. Now the correct label is return.
Changes done for MNIST dataset.
TODO: do the same for the FashionMNist Dataset.